package com.boolib.commons.util;

import java.util.UUID;

public class PasswordUtil {


    /**
     *  获取加密后的密码
     * @param pass 未加密的密码
     * @param salt 数据库的salt
     * @return  加密后密码 和数据库比对
     */
    public static String getEncryptPass2(String pass,String salt ){
        StringBuffer stringBuffer = new StringBuffer();
       return EncryptUtil.sha256C2( stringBuffer.append(pass).append(salt).toString());
    }


    public static String getEncryptPass3(String pass,String salt ){
        StringBuffer stringBuffer = new StringBuffer();
        return EncryptUtil.sha256C3( stringBuffer.append(pass).append(salt).toString());
    }

    public static String getEncryptPass5(String pass,String salt ){
        StringBuffer stringBuffer = new StringBuffer();
        return EncryptUtil.sha256C5( stringBuffer.append(pass).append(salt).toString());
    }

    public static String getSalt(){
        return UUID.randomUUID().toString().replace("-","");
    }
}

